﻿namespace WebPacker.Tool.Tests.EqualityComparers
{
	using System.Collections.Generic;
	using NUnit.Framework;
	using WebPacker.VersionGenerators;

	internal class VersionGeneratorEqualityComparer : IEqualityComparer<IVersionGenerator>
	{
		public bool Equals(IVersionGenerator x, IVersionGenerator y)
		{
			if (x == null || y == null)
			{
				return false;
			}

			if (x.Name != y.Name)
			{
				return false;
			}

			Assert.AreEqual(x.GetType(), y.GetType());

			return true;
		}

		public int GetHashCode(IVersionGenerator obj)
		{
			return obj.GetHashCode();
		}
	}
}
